#ifndef AVIATION_AIRPORT_H
#define AVIATION_AIRPORT_H

#include <string>

#include <boost/serialization/nvp.hpp>

namespace aviation
{
/// This class represents an airport code in the form XYZ.
class Airport
{
public:
	typedef std::string String;
	
	//Constructors

	//Intialises airport code
	Airport();

	/// Creates an airport code as a string.
	/// \param fcgString A string containing the airport code from an FCGDATA file.
	Airport(const String& fcgString);

	/// Copies the airport code from another.
	Airport(const Airport& other);

	/// Destructs the airport code.
	~Airport();

	/// Serialization (file I-O) function.
	/// \param ar A boost::archive formatter type.
	/// \param version The file version.
	template <class Archive>
	void serialize(Archive& ar, const unsigned int version);

	//Operators

	/// Assigns the content of one airport code to another.
	Airport& operator=(const Airport& other);

	/// Tests for equality between 2 airport codes.
	/// \returns True if they are the same and false if they are different.
	const bool operator==(const Airport& other) const;

	/// Tests for inequality between 2 airport codes.
	/// \returns True if they are different and false if they are the same.
	const bool operator!=(const Airport& other) const;
	
	// Accessors

	/// Gets the airport code as a string.
	/// \returns The airport code formatted as a string.
	const String AsString() const;

private:
	String m_airportString;
};

template <class Archive>
void Airport::serialize(Archive& ar, const unsigned int version)
{
	ar & BOOST_SERIALIZATION_NVP(m_airportString);
}

}//namespace aviation

#endif // AVIATION_AIRPORT_H